package com.qk.management.mapper;

import com.qk.domain.user.UserDO;
import com.qk.dto.user.UserDTO;
import com.qk.dto.user.UserLoginDTO;
import com.qk.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface UserMapper {

    List<UserDO> selectByPage(UserDTO userDTO);

    void insert(User user);

    void deleteByIds(List<Integer> ids);

    @Select("SELECT * FROM user WHERE id = #{id}")
    UserDO selectById(Integer id);

    void update(User user);

    List<UserDO> selectByRoleLabel(String roleLabel);

    List<UserDO> selectByDeptId(Integer deptId);

    @Select("SELECT * FROM user WHERE username = #{username}")
    User selectByUsername(UserLoginDTO dto);

    @Select("SELECT name FROM user WHERE id = #{id}")
    String selectNameById(Integer integer);
}
